#!/bin/bash
# chkconfig: 2345 55 25
# description: baota - ss-plugin

### BEGIN INIT INFO
# Provides:          ss
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts ss
# Description:       starts the ss
### END INIT INFO

configFile=/www/server/panel/plugin/ss/config.json
if [ ! -f $configFile ];then
	echo 'Ss-plugin plug-in is not installed.'
	exit;
fi

case "$1" in
        'start')
                ssserver -c $configFile -d start --user ssuser
                ;;
        'stop')
                ssserver -c $configFile -d stop --user ssuser
                ;;
        'restart')
                ssserver -c $configFile -d restart --user ssuser
                ;;
        *)
                echo "Usage: /etc/init.d/ss {start|stop|restart}"
        ;;
esac
